<?php

namespace App\Http\Controllers;

use App\RealNews;
use Illuminate\Http\Request;

use App\Http\Requests;

class RealNewsController extends Controller
{
    public function detail(Request $request)
    {
        $id = $request->id;
        $id = ($id) ? intval($id) : 0;
        if (!$id) {
            return redirect("/");
        }

        $news = RealNews::where('id',$id)->first();

        $data = array();
        if ($news) {
            $data['news'] = $news;
        }
        return view('newsdetail',$data);
    }
}
